import {Component, OnInit} from '@angular/core';

import {WebsiteService} from '../../service/website.service';

@Component({
  selector: 'app-index',
  templateUrl: './website.component.html',
  styleUrls: ['./website.component.css']
})
export class WebsiteComponent implements OnInit {
  weixinCodeCovers = []; // 微信二维码类别封面

  /**
   * 构造函数
   */
  constructor(private websiteService: WebsiteService) {
    /**
     * 监听子组件推送的消息
     */
    websiteService.websiteObservable.subscribe(websiteVariable => {
      /**
       * 加载封面图片
       */
      if (websiteVariable.weixinCodeCovers) {
        this.weixinCodeCovers = websiteVariable.weixinCodeCovers;
      }
    });
  }

  /**
   * 初始化函数
   */
  ngOnInit() {
  }

}
